package src.cs2340.todoApp;

/**
 * @author Kristian
 * @version 1.10 March 9, 2012
 * Defines the features/properties of a single task on the Android App.
 */
public class TaskItem
{
	private String itemName;
	private Location location;
	private Date dueDate;
	private String detailDescrip;
	private String category;
	private boolean checked;
	
	/**
	 * Constructor.
	 * @param itemName The name of the Task.
	 * @param location Where the Task takes place.
	 * @param dueDate Deadline for which the Task has to be done.
	 * @param detailDescrip A detailed description of what the Task entails.
	 * @param category A general classification of what kind of Task this is.
	 */
	public TaskItem(String itemName, Location location, Date dueDate,
			String detailDescrip, String category, boolean checked)
	{
		this.itemName = itemName;
		this.location = location;
		this.dueDate = dueDate;
		this.detailDescrip = detailDescrip;
		this.category = category;
		this.setChecked(checked);
	}
	
	/**
	 * A getter for itemName.
	 * @return itemName
	 */
	public String getItemName()
	{
		return itemName;
	}
	
	/**
	 * A setter for ItemName. Overwrites itemName with the String 
	 * specified in the parameter.
	 * @param itemName The new name of the TaskItem.
	 */
	public void setItemName(String itemName)
	{
		this.itemName = itemName;
	}
	
	/**
	 * A getter for Location.
	 * @return location
	 */
	public Location getLocation()
	{
		return location;
	}
	
	/**
	 * A setter for Location. Overwrites location with the Location 
	 * specified in the parameter.
	 * @param location The new Location the TaskItem holds.
	 */
	public void setLocation(Location location)
	{
		this.location = location;
	}
	
	/**
	 * A getter for DueDate.
	 * @return dueDate
	 */
	public Date getDueDate()
	{
		return dueDate;
	}
	
	/**
	 * A setter for DueDate. Overwrites dueDate with the Date
	 * specified in the parameter.
	 * @param dueDate The new dueDate of the TaskItem.
	 */
	public void setDueDate(Date dueDate)
	{
		this.dueDate = dueDate;
	}
	
	/**
	 * A getter for detailDescrip.
	 * @return detailDescrip
	 */
	public String getDetailDescrip()
	{
		return detailDescrip;
	}
	
	/**
	 * A setter for the TaskItem's detailed description.  Overwrites the old
	 * description with the parameter in the String. 
	 * @param detailDescrip The TaskItem's new detailed description.
	 */
	public void setDetailDescrip(String detailDescrip)
	{
		this.detailDescrip = detailDescrip;
	}
	
	/**
	 * A getter for category.
	 * @return category
	 */
	public String getCategory()
	{
		return category;
	}
	
	/**
	 * A setter for category.  Overwrites the TaskItem's current category with the
	 * one in parameters.
	 * @param category The new category the TaskItem holds.
	 */
	public void setCategory(String category)
	{
		this.category = category;
	}
	
	/**
	 * @param checked the checked to set
	 */
	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	/**
	 * @return the checked
	 */
	public boolean isChecked() {
		return checked;
	}

	/**
	 * To string method to display the TaskItem name
	 */
	@Override
	public String toString() {
		return itemName;
	}
}
